<template>
    <div>
        账号:<input type="text" v-model="loginUser.acc">
        <button @click="handler">提交</button>
    </div>
</template>

<script setup>
import { reactive,ref } from 'vue';
import { useRouter } from 'vue-router';

const router = useRouter()

const loginUser  = reactive({
    acc:''
})

const handler = e =>{
    if(loginUser.acc == 'admin'){
        router.push({path:'/admin/:accout',query:{accout:loginUser.acc}})
    } else {
        router.push({path:'/user/:accout',query:{accout:loginUser.acc}})
    }
}
</script>

<style lang="scss" scoped>

</style>